﻿@model IEnumerable<DataHelper.BK_Order>
@{
    Lang lang = ViewBag.Lang;
    ViewBag.Title = lang.ORDERTICKET;
    Layout = "~/Views/Shared/_LayoutMember.cshtml";
}

<div class="panel panel-default">
    <div class="panel-heading">
        <i class="fa fa-external-link-square"></i>@lang.ORDERTICKET
        <div class="panel-tools">
            <a class="btn btn-xs btn-link panel-collapse collapses" href="#"></a><a class="btn btn-xs btn-link panel-config"
                href="#panel-config" data-toggle="modal"><i class="fa fa-wrench"></i></a><a class="btn btn-xs btn-link panel-refresh"
                    href="#"><i class="fa fa-refresh"></i></a><a class="btn btn-xs btn-link panel-expand"
                        href="#"><i class="fa fa-resize-full"></i></a><a class="btn btn-xs btn-link panel-close"
                            href="#"><i class="fa fa-times"></i></a>
        </div>
    </div>
    <div class="panel-body">
        <table class="table table-hover" id="sample-table-1">
            <thead>
                <tr>
                    <th class="center">
                        #
                    </th>
                    <th class="hidden-xs">
                        @lang.NAME
                    </th>
                    <th>
                        @lang.PHONE
                    </th>
                    <th class="hidden-xs">
                        @lang.ORDERTICKET
                    </th>
                    <th>
                        @lang.CREATEDDATE
                    </th>
                    <th>
                    </th>
                </tr>
            </thead>
            <tbody>
                @{
                    foreach (var item in Model)
                    {
                    <tr>
                        <td class="center">
                            @item.ID
                        </td>
                        <td class="hidden-xs" >
                            @item.Name
                        </td>
                        <td>
                            @item.Phone
                        </td>
                        <td>
                            @item.Note
                        </td>
                        <td class="hidden-xs">
                            @item.CreatedDate.Value.ToString("dd/MM/yyyy HH:mm")
                        </td>
                        <td class="center">
                            <div class="visible-md visible-lg hidden-sm hidden-xs">
                                <a onclick='delete_order(@item.ID)' href="javascript:void(0)" class="btn btn-xs btn-bricky tooltips"
                                            data-placement="top" data-original-title="Remove"><i class="fa fa-times fa fa-white">
                                            </i></a>
                            </div>
                            <div class="visible-xs visible-sm hidden-md hidden-lg">
                                <div class="btn-group">
                                    <a class="btn btn-primary dropdown-toggle btn-sm" data-toggle="dropdown" href="#"><i
                                        class="fa fa-cog"></i><span class="caret"></span></a>
                                    <ul role="menu" class="dropdown-menu pull-right">
                                        <li role="presentation"><a role="menuitem" tabindex="-1" href="#"><i class="fa fa-edit">
                                        </i>Edit </a></li>
                                        <li role="presentation"><a role="menuitem" tabindex="-1" href="#"><i class="fa fa-share">
                                        </i>Share </a></li>
                                        <li role="presentation"><a role="menuitem" tabindex="-1" href="#"><i class="fa fa-times">
                                        </i>Remove </a></li>
                                    </ul>
                                </div>
                            </div>
                        </td>
                    </tr>
                    }
                }
            </tbody>
        </table>
        
        @Html.Partial("UserControl/OnDisplayPaggingAdmin")
    </div>
</div>


<script>
    function delete_order(id) {
        if (confirm(" @lang.CONFIRM ")) {
            //alert(id_lang);
            window.location.href = "/Admin/DeleteOrder/" + id;
        }
    }
</script>
